package com.zjc.yohoshop.mvp.view.adapter;

import android.view.View;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.makeramen.roundedimageview.RoundedImageView;
import com.zjc.yohoshop.R;
import com.zjc.yohoshop.bean.ShowEntity;
import com.zjc.yohoshop.network.API;

public class ShowAdapter extends BaseQuickAdapter<ShowEntity.ValuesBean, BaseViewHolder> {
    public ShowAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder helper, ShowEntity.ValuesBean item) {
        RoundedImageView riv_item_show_user_head = helper.getView(R.id.riv_item_show_user_head);
        RoundedImageView riv_item_show_img_path = helper.getView(R.id.riv_item_show_img_path);
        RoundedImageView riv_item_show_goods_img_path = helper.getView(R.id.riv_item_show_goods_img_path);

        Glide.with(helper.itemView.getContext()).load(API.BaseUrl + item.user_head).into(riv_item_show_user_head);
        Glide.with(helper.itemView.getContext()).load(API.BaseUrl + item.img_path).into(riv_item_show_img_path);
        Glide.with(helper.itemView.getContext()).load(API.BaseUrl + item.goods_img_path).into(riv_item_show_goods_img_path);

        helper.setText(R.id.tv_item_show_nick_name, item.nick_name);
        helper.setText(R.id.tv_item_show_goods_name, item.goods_name);
        helper.setText(R.id.tv_item_show_goods_discount_price, "￥" + item.goods_discount_price);
        helper.setText(R.id.tv_item_show_fabulous, item.fabulous);

    }
}
